import Vue from 'vue'
import Vuex from 'vuex'
import * as actions from './actions'
import * as getters from './getters'

Vue.use(Vuex)

// 应用初始状态
const state = {
    count: 10,
    token:'',
    menuList:null,
//  url:"",
//  url:"/sapi",
//  url: "http://wy518.cc:8899",
      url:"http://wy518.cc:8897",
    upload:"http://116.62.22.58:8030/bapi/fileupload"
}
// 定义所需的 mutations
const mutations = {
    INCREMENT(state) {
        state.count++
    },
    DECREMENT(state) {
        state.count--
    },
    SETTOKEN(state,token){
        state.token = token
    },
    SETMENULIST(state,menuList){
        state.menuList = menuList
    }
}

// 创建 store 实例
export default new Vuex.Store({
    actions,
    getters,
    state,
    mutations
})